#include <iostream>
using namespace std;

typedef long long ll; //防止爆int

const int N = 1010;

int n, m;       //数组长度与指令数量
int a[N];       //原数组
int b[N];       //差分数组
int tr[N];      //b的树状数组
char op;        //获取指令
int l, r, d, x; //指令参数

int lowbit(int x)
{
    return x & -x;
}

void init()
{
    for (int i = 1; i <= n; ++i) //遍历每个数组
    {
        tr[i] += b[i];         //至少有我自己
        int p = i + lowbit(i); //找到父节点
        if (p <= n)
            tr[p] += tr[i];
    }
    return;
}

ll sum(int x)
{
    ll sum = 0;
    for (int i = x; i > 0; i -= lowbit(i))
        sum += tr[i];
    return sum;
}

void add(int i, int c)
{
    b[i] += c;                              //先修改母数组
    for (int j = i; j <= n; j += lowbit(j)) //然后找到受影响的祖宗结点们
        tr[j] += c;
    return;
}

int main()
{
    cin >> n >> m;
    for (int i = 1; i <= n; ++i)
    {
        cin >> a[i];
        b[i] = a[i] - a[i - 1]; //初始化差分数组
    }
    init(); //初始化树状数组
    while (m--)
    {
        cin >> op;
        if (op == 'C')
        {
            cin >> l >> r >> d;
            add(l, d);
            add(r + 1, -d);
        }
        else
        {
            cin >> x;
            cout << sum(x) << endl;
        }
    }
    return 0;
}